<template>
    <a-popconfirm :title="_t('common.Delete.tip')" :ok-text="_t('common.Confirm')" :cancel-text="_t('common.Cancel')" :disabled="!disabled" @confirm="handleDelete">
        <a-button type="link" v-iscan="auth" danger>{{ _t('common.Delete.del') }}</a-button>
    </a-popconfirm>
</template>

<script lang="ts" setup>
    import { _t } from "@/assets/lang/index.ts"
    const props = defineProps<{
        auth?: string[],
    }>()
    import { isAuth } from '@/tool/function'
    const disabled = isAuth(props.auth || [])
    const emit = defineEmits(['delete'])
    const handleDelete = () => {
        emit("delete")
    }

</script>